﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using DcsGauges.Input.Events;

namespace DcsGauges.Gui.Rendering.Interfaces
{
    interface IGuiRenderable
    {
        
        Rectangle   ViewportRect    { get; }
        bool        Visible         { get; set; }

        void Render(SpriteBatch spriteBatch, GraphicsDevice device, Rectangle parentRect, float globalZIndex);
        void InjectMouseEvent(MouseEvent evt, GameTime gt);
        void InjectKeyboardEvent();
        void InjectTouchEvent();


    }

    class GuiRenderableContainer : List<IGuiRenderable>
    {
        public void Render(SpriteBatch uiBatch, GraphicsDevice device, Rectangle parentViewportRect, float zIndex)
        {
            foreach(var renderable in this)
            {
                renderable.Render(uiBatch, device, parentViewportRect, 0.5f);
            }
        }
    }
}
